package com.nengchuan.kbms.dfs.controller.center;


import com.nengchuan.kbms.dfs.annotation.UserOperateLogger;
import com.nengchuan.kbms.dfs.entity.dto.DataShareDTO;
import com.nengchuan.kbms.dfs.service.DataShareService;
import com.nengchuan.model.model.WrappedResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 文件分享 前端控制器
 * </p>
 *
 * @author abe
 * @since 2020-03-31
 */
@RestController
@RequestMapping("/center/sharing")
@Api(tags = "知识库数据后台管理 > 数据中心 > 分享【已完成】")
public class SharingController {

    @Autowired
    private DataShareService dataShareService;

    @PostMapping("/share")
    @ApiOperation(value = "分享")
    @UserOperateLogger(type = UserOperateLogger.Type.SHARE)
    public WrappedResult<Long> share(@RequestBody DataShareDTO dataShareDTO) {
        return WrappedResult.success(dataShareService.share(dataShareDTO));
    }

}
